<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>mall</title>
    <!--导入依赖-->
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../my/css/back.css">
    <script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/axios.min.js"></script>


</head>

<body>

<div>
    <!--导航栏-->
    <div>
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" style="margin-left: 25px" href="#">白大师后台管理系统</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="#">搜 索</a></li>
                    <li><a href="#">欢迎您：admin</a></li>
                    <li><a href="#">退出登录</a></li>
                </ul>
                <form class="navbar-form navbar-right">
                    <input type="text" class="form-control" placeholder="Search...">
                </form>
            </div>
        </div>
    </nav>
    </div>
    <!--主体部分-->
    <div>
    <div class="container-fluid">
        <div class="row">
            <div class=" col-md-2 col-sm-3 ">
                <div class="sidebar">
                    <ul class="nav nav-sidebar nav-center">
                        <li>
                        <img src="../image/cat.png" width="150px" height="150px" class="img-circle">
                        </li>
                    </ul>
                    <ul class="nav nav-sidebar nav-center">
                        <li><a href="index.html" class="bg-primary">商品管理</a></li>
                        <li><a href="category.html">类别管理</a></li>
                        <li><a href="order.html">订单管理</a></li>
                        <li><a href="user.html">用户管理</a></li>
                        <li><a href="">通知公告</a></li>
                        <li><a href="">我的账户</a></li>
                    </ul>
                </div>
            </div>
            <div class="col-md-10 main" id="backItemsApp">
                <h2 class="sub-header">商品管理</h2>
                <a class="btn btn-success" href="addItems.html" style="color: white;text-decoration: none">新增商品</a></button>
                <button type="button" class="btn btn-danger">批量删除</button>
                <div class="table-responsive">
                    <table class="table myTable">
                        <thead>
                        <tr>
                            <th>
                                <label class="all-choice">
                                    <input type="checkbox">
                                </label>
                            </th>
                            <th>商品名称</th>
                            <th>商品主图</th>
                            <th>商品类别</th>
                            <th>商品单价</th>
                            <th>商品简介</th>
                            <th>商品规格</th>
                            <th>商品库存</th>
                            <th>商品状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <tr v-for="(item,index) in items">
                                <td>
                                    <label class="all-choice">
                                        <input type="checkbox" :value="item.id">
                                    </label>
                                </td>
                                <td v-text="item.itemsName">商品名称</td>
                                <td><img height="80px" width="80px" :src="'../'+item.itemsImg.url"></td>
                                <td v-text="item.category.catName">商品类别</td>
                                <td v-text="item.price">商品单价</td>
                                <td v-text="item.synopsis">商品简介</td>
                                <td v-text="item.specification">商品规格</td>
                                <td v-text="item.stock">商品库存</td>
                                <td v-text="item.status">商品上下架</td>
                                <td>
                                    <a class="btn btn-info" style="text-decoration: none;color: white" :href="'/back/updateItems.html?'+item.id">修改</a>
                                    <button type="button" class="btn btn-warning" @click.prevent="deleteItem(item.id,index,items)">删除</button>
                                </td>
                            </tr>
                        </tbody>
                    </table>

                    <div class="col-sm-9">
                        <div class="col-sm-7 col-md-offset-4">
                            <!--分页开始-->
                            <nav aria-label="Page navigation">
                                <ul class="pagination">
                                    <li>
                                        <a href="#" aria-label="Previous" @click.prevent="loadBackItems(pageInfo.prePage)" v-if="!pageInfo.isFirstPage">
                                            <span aria-hidden="true">上一页</span>
                                        </a>
                                    </li>
                                    <li >
                                        <a  v-for="num in pageInfo.navigatepageNums" href="#" v-text="num" @click.prevent="loadBackItems(num)" :style="{'background':(num==pageInfo.pageNum ?'Silver':'')}" >1</a>
                                    </li>
                                    <li >
                                        <a href="#" aria-label="Next" @click.prevent="loadBackItems(pageInfo.nextPage)" v-if="!pageInfo.isLastPage">
                                            <span aria-hidden="true">下一页</span>
                                        </a>
                                    </li>
                                </ul>
                            </nav>
                        </div>

                    </div>

                </div>
            </div>

        </div>
    </div>
    </div>

</div>

</body>
<script src="../my/js/back-items.js"></script>

</html>
